<template>
  <view class="coinbankIndex">
    <view class="pledgeCoins" v-for="item in productList" :key="item.id">
      <view class="banner">
        <view class="bannerBottom">
          <view class="bannerBottomLeft">
            <uni-icons type="checkmarkempty" color="#000"></uni-icons>
            <view class="state"> {{ $t('trade.has_done') }} </view>
          </view>
          <view class="bannerBottomRight">{{ item.createTime }}</view>
        </view>
      </view>

      <view class="specificPledgeInfo">
        <view class="specificPledgeInfoItem">
          <text style="font-size: 24rpx">{{ $t('bico.W355') }}</text>
          <text style="font-weight: bold">{{ item.totalDistribution }} {{ item.name }} </text>
        </view>

        <view class="specificPledgeInfoItem">
          <text style="font-size: 24rpx">{{ $t('mining.text30') }}</text>
          <text style="font-weight: bold; font-size: 24rpx"
            >1 {{ item.name }} = {{ item.equivalenceBnbPrice }} BNB</text
          >
        </view>

        <view class="specificPledgeInfoItem">
          <text style="font-size: 24rpx">{{ $t('mining.text31') }}</text>
          <text style="font-weight: bold; font-size: 24rpx"
            >{{ item.participantNum }} {{ $t('mining.text33') }}</text
          >
        </view>

        <view class="specificPledgeInfoItem">
          <text style="font-size: 24rpx">{{ $t('mining.text32') }}</text>
          <text style="font-weight: bold; font-size: 24rpx"
            >{{ item.totalInvestmentPrice }} BNB</text
          >
        </view>
      </view>
    </view>
  </view>
</template>

<script>
import { productList } from '../../../common/apiString';
export default {
  data() {
    return {
      productList: []
    };
  },
  mounted() {
    this.getProductList();
  },
  methods: {
    skip(url) {
      uni.navigateTo({
        url: url
      });
    },
    // 获取质押产品列表;
    getProductList() {
      this.$utils.initDataToken({ url: productList, data: {}, type: 'get' }, (res, msg) => {
        this.productList = res.filter(item => item.isEnd == 1);
      });
    }
  }
};
</script>

<style lang="less" scoped>
.coinbankIndex {
  background: #1f282f;
  height: 100%;
  .pledgeCoins {
    padding: 0 30rpx 30rpx;
    background: #1f282f;

    .banner {
      height: 360rpx;
      background: #000000;
      border-radius: 20rpx 20rpx 20rpx 20rpx;
      position: relative;
      .bannerBottom {
        padding: 30rpx;
        width: 100%;
        position: absolute;
        bottom: 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        .bannerBottomLeft {
          display: flex;
          align-items: center;
          .state {
            color: #fff;
            margin-left: 10rpx;
            font-size: 24rpx;
          }
          .uni-icons {
            width: 31rpx;
            height: 31rpx;
            background: #fff;
            border-radius: 50%;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 24rpx !important;
          }
        }

        .bannerBottomRight {
          color: #fff;
          font-size: 24rpx;
        }
      }
    }
    .specificPledgeInfo {
      .specificPledgeInfoItem {
        margin-top: 40rpx;
        display: flex;
        justify-content: space-between;
        align-items: center;
        color: #fff;
      }
    }
  }
}
</style>
